import React, { Component } from 'react'

// 定义事件的4中方式
// 1.在 render 的函数内部直接使用箭头函数,箭头函数的默认参数为event
export default class App extends Component {
  state = {
    count: 10
  }
  render() {
    return (
      <div>
        <button onClick = { (event) => {
          console.log(event)
          this.setState({
            count: this.state.count + 1
          })
        } }>加1</button>
      </div>
    )
  }
}
